package com.pxl.springbootinit.model.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 物品物流状态表
 * @TableName item_logistics
 */
@TableName(value ="item_logistics")
@Data
public class ItemLogistics implements Serializable {
    /**
     * 物流状态ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 物品ID（关联item表）
     */
    private Long itemId;

    /**
     * 受捐者id
     */
    private Long receivedId;

    /**
     * 物流状态（待发货、运输中、已送达）
     */
    private String logisticsStatus;

    /**
     * 物流公司名称
     */
    private String logisticsProvider;

    /**
     * 物流单号
     */
    private String trackingNumber;

    /**
     * 物品当前所在位置
     */
    private String currentLocation;

    /**
     * 物流创建更新时间
     */
    private Date createdTime;


    /**
     * 物流状态最后更新时间
     */
    private Date updatedTime;

    /**
     *
     */
    @TableLogic
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ItemLogistics other = (ItemLogistics) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
                && (this.getItemId() == null ? other.getItemId() == null : this.getItemId().equals(other.getItemId()))
                && (this.getLogisticsStatus() == null ? other.getLogisticsStatus() == null : this.getLogisticsStatus().equals(other.getLogisticsStatus()))
                && (this.getLogisticsProvider() == null ? other.getLogisticsProvider() == null : this.getLogisticsProvider().equals(other.getLogisticsProvider()))
                && (this.getTrackingNumber() == null ? other.getTrackingNumber() == null : this.getTrackingNumber().equals(other.getTrackingNumber()))
                && (this.getCurrentLocation() == null ? other.getCurrentLocation() == null : this.getCurrentLocation().equals(other.getCurrentLocation()))
                && (this.getUpdatedTime() == null ? other.getUpdatedTime() == null : this.getUpdatedTime().equals(other.getUpdatedTime()))
                && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getItemId() == null) ? 0 : getItemId().hashCode());
        result = prime * result + ((getLogisticsStatus() == null) ? 0 : getLogisticsStatus().hashCode());
        result = prime * result + ((getLogisticsProvider() == null) ? 0 : getLogisticsProvider().hashCode());
        result = prime * result + ((getTrackingNumber() == null) ? 0 : getTrackingNumber().hashCode());
        result = prime * result + ((getCurrentLocation() == null) ? 0 : getCurrentLocation().hashCode());
        result = prime * result + ((getUpdatedTime() == null) ? 0 : getUpdatedTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", itemId=").append(itemId);
        sb.append(", logisticsStatus=").append(logisticsStatus);
        sb.append(", logisticsProvider=").append(logisticsProvider);
        sb.append(", trackingNumber=").append(trackingNumber);
        sb.append(", currentLocation=").append(currentLocation);
        sb.append(", updatedTime=").append(updatedTime);
        sb.append(", isDeleted=").append(isDeleted);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}